<template>
    <div class='newlist'>
        <ul class="mui-table-view" v-for='v in list'>
            <li class="mui-table-view-cell mui-media">
                <router-link v-bind="{to:'/news/newsinfo/'+v.id}" >
                    <img class="mui-media-object mui-pull-left" :src="v.img_url">
                    <div class="mui-media-body mui-ellipsis">
                        {{v.title}}
                        <p class='mui-ellipsis'>{{v.zhaiyao}}</p>
                        <div class="ft">
                            <span>发表时间:{{v.add_time | datefmt('YYYY-MM-DD HH:mm:ss')}}</span>
                            <span class="click">点击数：{{v.click}}</span>
                        </div>
                    </div>
                </router-link>
            </li>
        </ul>

    </div>
</template>
<script>
    import common from '../../kits/common'
    import {Toast} from 'mint-ui';
    export default {
        data(){
            return {
                list: []
            }
        },
        created(){
            this.getNewsList();
        },
        methods: {
            getNewsList(){
                var url = common.apidomain+'/api/getnewslist';
                this.$http.get(url).then(function (res) {
                    var data = res.body;
                    if (data.status != 0) {
                        Toast(data.message);
                        return;
                    }
                    this.list = data.message;
                })
            }
        }
    }
</script>
<style scoped>
    .mui-table-view img {
        height: 70px;
        width: 70px;
    }

    .mui-table-view .mui-media-object {
        max-width: 70px;
        line-height: 70px;
    }

    .mui-media-body {
        font-size: 15px;
    }

    .ft {
        margin-top: .5em;
        font-size: 14px;
        color: #0094ff;
    }

    .ft .click {
        margin-left: 20px;
    }
</style>